class FightPlayerController extends UTPlayerController;

var FightPawn p;
var bool blocking;
var float StartSeconds;
var float downTime;
var float blockDelay;
var float weaponCooldown;
var() bool Died;

defaultproperties
{
	downTime = 2;
	blockDelay= 0.3;
	weaponCooldown = 0.7;
}

simulated event PostBeginPlay()
{
	super.PostBeginPlay();
	p = FightPawn(Pawn);
}

event PlayerTick(float deltaTime){

	super.PlayerTick(deltaTime);

	FightPawn(Pawn).Mesh = none;

	if(blocking){
		if(WorldInfo.TimeSeconds > (StartSeconds+downTime-blockDelay)){
			blocking = false;
		}
	}	
}

function Block(){
	if(WorldInfo.TimeSeconds > (StartSeconds+downTime)){
		blocking = true;
		downTime = 1.0;
		FightPawn(Pawn).PlayBlockAnimation();
		StartSeconds = WorldInfo.TimeSeconds;
	}
}

/*function StartFire( optional byte FireModeNum )
{
	Pawn.StartFire( FireModeNum );
	//StartSeconds = WorldInfo.TimeSeconds;
	/*if(FireModeNum == 1){
		Pawn.StartFire( 1 ); // block
	}else{
		//if(WorldInfo.TimeSeconds > StartSeconds + weaponCooldown){
			Pawn.StartFire( 0 ); // aanval
		//	StartSeconds = WorldInfo.TimeSeconds;
		//}
	}*/
}*/


// override
/*function Rotator GetAdjustedAimFor( Weapon W, vector StartFireLoc )
{
	local rotator BaseAimRot;
	BaseAimRot = Pawn.Rotation;
   	return BaseAimRot;
}*/